keyMap = {
    "name": "材料名称",
    "poissonRatio": "泊松比",
    "fatigueStrengthCoefficient": "疲劳强度系数",
    "fatigueDuctilityCoefficient": "疲劳延性系数",
    "fatigueStrengthExponent": "疲劳强度指数",
    "elasticModulus": "弹性模量",
    "fatigueDuctilityExponent": "疲劳延性指数",
    "cyclicStrengthCoefficient": "循环强度系数",
    "CyclicStrainHardening": "循环应变硬化指数",
}

valueMap = {
    "材料名称": "name",
    "泊松比": "poissonRatio",
    "疲劳强度系数": "fatigueStrengthCoefficient",
    "疲劳延性系数": "fatigueDuctilityCoefficient",
    "疲劳强度指数": "fatigueStrengthExponent",
    "弹性模量": "elasticModulus",
    "疲劳延性指数": "fatigueDuctilityExponent",
    "循环强度系数": "cyclicStrengthCoefficient",
    "循环应变硬化指数": "CyclicStrainHardening",
}


def convertKey(data, type):
    res = {}
    if type == 0:
        for key, values in data.items():
            if valueMap.get(key):
                res[valueMap.get(key)] = values
            else:
                res[key] = values

    elif type == 1:
        for key, values in data.items():
            if keyMap.get(key):
                res[keyMap.get(key)] = values
            else:
                res[key] = values

    return res
